<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set value="${ctx}" var = "ctx"/>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>MMLOO</title>
  <link rel="stylesheet" href="${ctx}/resources/plugins/bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="${ctx}/resources/css/webuploader.css">
  <link rel="stylesheet" href="${ctx}/resources/plugins/image_css/global.css">
  <link rel="stylesheet" href="${ctx}/resources/css/global.css">

  <!--[if lt IE 9]>
  <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body>
<jsp:include page="../../home/navigator.jsp"></jsp:include>

<div class="container" style="width:1200px;height:600px;color:#66afe9">

  <div class="row">

     <%-- <div class="water col-sm-6">

      </div>--%>

    <div class="col-sm-6 pull-right">
      <form id="searchForm" method="post" action="/manage/goods/list">
        <div class="input-group">
          <input id="pageNo" name="pageNo" type="hidden" value="${pager.pageNo}"/>
          <input id="pageSize" name="pageSize" type="hidden" value="${pager.pageSize}"/>
          <a class="btn btn-primary btn-xs" data-toggle="tooltip" title="添加商品" href="${pageContext.request.contextPath}/manage/goods/add">
            添加商品 <%--<span class="glyphicon glyphicon-plus"></span>--%>
          </a>
          <span class="input-group-addon">商品：</span>
          <input type="text" class="form-control" name="keyword" value="${keyword}"
                 placeholder="请输入你要查询的商品" required>
                        <span class="input-group-btn">
                          <button class="btn btn-default" type="submit" onclick="return page();">查询</button>
                        </span>
        </div>
      </form>
    </div>
  </div>
  <div class="row">
    <div class="col-sm-12">

        <div class="main-content">
          <div class="bs-docs-example" style="margin-top: 3px;">
            <div style="margin-bottom: 3px;" class="btn-group">
              <a class="btn btn-primary btn-xs" href="${ctx}/manage/goods/list?pageNo=${pager.pageNo}&pageSize=${pager.pageSize}&sale_type=1">最新</a>
              <a class="btn btn-primary btn-xs" href="${ctx}/manage/goods/list?pageNo=${pager.pageNo}&pageSize=${pager.pageSize}&sale_type=2">特卖</a>
              <a class="btn btn-primary btn-xs" href="${ctx}/manage/goods/list?pageNo=${pager.pageNo}&pageSize=${pager.pageSize}&sale_type=3">热卖</a>
              <a class="btn btn-primary btn-xs" href="${ctx}/manage/goods/list?pageNo=${pager.pageNo}&pageSize=${pager.pageSize}&sale_type=4">推荐</a>
            </div>
          </div>
          <form action="${ctx}/manage/goods/promotion/groupBuy/add/json" method="post">
          <table class="table">
            <thead>
            <tr>
              <c:if test="${select eq 1}">
                <th>选择</th>
              </c:if>
              <th>编号</th>
              <th>名称</th>
              <th>简介</th>
              <th>上架时间</th>
              <th>售卖类型</th>
              <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${pager.list}" var="goods">
              <tr class="success">
                <c:if test="${select eq 1}">
                  <td><label>
                    <input type="checkbox" name="select" value="${goods.id}"/>
                  </label></td>
                </c:if>
                <td>${goods.number}</td>
                <td>${goods.name}</td>
                <td>${goods.brief}</td>
                <td>${goods.showtime}</td>
                <td>
                  <c:if test="${goods.sale_type eq 1}">
                    最新
                  </c:if>
                  <c:if test="${goods.sale_type eq 2}">
                    特卖
                  </c:if>
                  <c:if test="${goods.sale_type eq 3}">
                    热卖
                  </c:if>
                  <c:if test="${goods.sale_type eq 4}">
                    推荐
                  </c:if>
                </td>
                <td>
                  <a      href="${ctx}/manage/goods/add?id=${goods.id}"
                          class="btn btn-primary btn-xs"
                          >编辑
                  </a>
                  &nbsp;&nbsp;
                  <a class="btn btn-primary btn-xs"
                          href="javascript:void(0)" data-toggle="tooltip" title="删除"
                          onclick="if (confirm('确认要删除本记录吗？此操作将不可恢复！'))
                                  location = '<c:url
                                  value="${ctx}/manage/goods/delete?id=${goods.id}"/>';
                                  return false;">删除
                  </a>

                </td>
              </tr>
            </c:forEach>

            </tbody>
          </table>
            <c:if test="${select eq 1}">

              <input type="submit" value="确定" class="btn btn-primary"/>
            </c:if>
          </form>

        </div>
      <%--</div>--%>
    </div>
  </div>
  <div class="row">
    <div class="col-sm-12">
      ${pager}
    </div>
  </div>
</div>
<script src="${ctx}/resources/plugins/jquery-2.0.3.min.js"></script>
<script src="${ctx}/resources/plugins/bootstrap/js/bootstrap.js"></script>
<script src="${ctx}/resources/js/webuploader/webuploader.min.js"></script>
<script src="${ctx}/resources/js/jquery.masonry.min.js"></script>
<script src="${ctx}/resources/js/global.js"></script>
<script src="${ctx}/resources/js/manage.js"></script>
<script src="${ctx}/resources/plugins/image_global/global.js"></script>

</body>
</html>
